/*
 * @Description: 附近站点模块中的，站点信息模块
 * @Author: yingying.fan
 * @Date: 2019-06-11 10:41:48
 * @Last Modified by: yingying.fan
 * @Last Modified time: 2019-06-11 16:37:28
 */
export default class StationInfoModel {
  /**
   *
   * @param {String} stationId 站点id
   * @param {String} stationName 站点名称
   * @param {Number} distance 站点距离当前定位的距离
   * @param {String} longitude 站点的经度
   * @param {String} latitude 站点的纬度
   * @param {Array} busList 当前站点下的车辆列表
   */
  constructor(stationId, stationName, distance, longitude, latitude, busList) {
    this.stationId = stationId
    this.stationName = stationName
    distance = parseFloat(distance)
    if (distance > 1000) {
      let kd = distance / 1000
      if (kd <= 10) {
        this.distance = kd + '公里'
      } else {
        this.distance = '超过10公里'
      }
    } else {
      this.distance = distance + '米'
    }
    this.longitude = longitude
    this.latitude = latitude
    this.busList = busList
  }
}
